blob: a2999dcf09a871546c7c1deab101c2bc61bb631a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<script context="module" lang="ts">
import type { SanityBlockArray } from "$lib/sanity/types/block-array";
export type ProductsModel = {
products: ProductModel[];
};
export type ProductModel = {
title: string;
duration: string;
cost: string;
description: SanityBlockArray;
orderLink: string;
};
</script>
<script lang="ts">
import CardV4 from "$components/card-v4.svelte";
import LL from "$i18n/i18n-svelte";
export let model: ProductsModel;
let visible = true;
$: if (!model.products || !model.products.length) {
visible = false;
} else {
visible = true;
}
</script>
{#if visible}
<div class="wrapper">
{#each model.products as product}
<CardV4 description={product.description} title={product.title}>
<div class="flex flex-wrap justify-end align-bottom">
<a href={product.orderLink} class="btn btn--primary">{$LL.goToBookingPage()}</a>
</div>
</CardV4>
{/each}
</div>
{/if}
<style lang="postcss">
.wrapper {
display: flex;
flex-direction: row;
gap: 1em
}
</style>
|